package com.iakuil.app.service.converter;

import com.iakuil.app.common.core.DefaultConverterConfig;
import com.iakuil.app.domain.dto.OperationLogDto;
import com.iakuil.app.domain.entity.OperationLog;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.extensions.spring.DelegatingConverter;
import org.springframework.core.convert.converter.Converter;

/**
 * 操作日志 对象转换器
 *
 * @author Kai
 * @date 2023-04-12
 **/
@Mapper(config = DefaultConverterConfig.class)
public interface OperationLogToOperationLogDtoConverter extends Converter<OperationLog, OperationLogDto> {

    /**
     * 实体类转DTO
     *
     * @param entity 实体类
     * @return DTO对象
     */
    @Override
    OperationLogDto convert(OperationLog entity);

    /**
     * DTO对象转实体对象
     *
     * @param dto DTO对象
     * @return 实体对象
     */
    @InheritInverseConfiguration
    @DelegatingConverter
    OperationLog invertConvert(OperationLogDto dto);
}
